<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>登录 - 光大好车</title>
		<meta content="光大好车" name="keywords" />
		<meta content="光大好车" name="description" />
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<script type="text/javascript" src="script/jquery.js"></script>
		<script type="text/javascript" src="script/bootstrap.min.js"></script>
		<script type="text/javascript" src="script/Validform_v5.3.2_min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				//表单验证
				$(".form-horizontal").Validform({
					tiptype: function(msg, o, cssctl) {
						var objtip = $("#regnotice");
						cssctl(objtip, o.type);
						objtip.text(msg);
					}
				});
			});
		</script>
	</head>

	<body>
		<div id="brand-box">
			<header class="mo-header">
				<div class="mo-header-left">
					<!--<a href="#"> 首页 </a> 
     <i class="iconfont"></i> -->
					<a href="#">大德二手车 </a>
				</div>
			</header>
		</div>
		<!--内容-->
		<div class="container mt20">
			<div class="login_main">
				<div class="mt20">
					<form name="loginform" class="form-horizontal" method="post" action="#">
						<div class="form-group">
							<div class="col-xs-10 col-xs-offset-1">
								<div id="regnotice" class="lognotice"></div>
							</div>
						</div>
						<div class="form-group">
							<div class="col-xs-10 col-xs-offset-1">
								<input type="text" id="mobilephone" class="form-control" placeholder="请输入手机号" name="mobilephone" datatype="m" sucmsg="手机号验证通过！" nullmsg="请输入手机号！" errormsg="请输入正确的手机号！" />
							</div>
						</div>
						
						<div class="form-group">
							<div class="col-xs-10 col-xs-offset-1">
								<input type="password" id="password" class="form-control" placeholder="请输入密码" name="password" datatype="m" sucmsg="手机号验证通过！" nullmsg="请输入手机号！" errormsg="请输入正确的手机号！" />
							</div>
						</div>
						<!--<div class="form-group">
							<div class="col-xs-5 col-xs-offset-1">
								<input type="text" placeholder="请输入验证码" class="form-control" name="authcode" nullmsg="请输入验证码！" errormsg="请输入正确的验证码！" />
							</div>
							<div class="col-xs-5">
								<input type="button" value="获取验证码" class="btn btn-default btn-block" id="sendmsg">
							</div>
						</div>-->
						<div class="form-group">
							<div class="col-xs-5 col-xs-offset-1">
								<input id="login" type="button" value="登 录" onclick="login()" class="btn btn-danger btn-block" />
							</div>
							<div class="col-xs-5">
								<a href="#" class="btn btn-default btn-block">注册</a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!--内容-->
		<!--<a href="javascript:;" id="returntop"></a>-->
		<script type="text/javascript" src="script/jquery.lazyload.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(function() {
				$("img.lazy").lazyload({
					effect: "fadeIn"
				});
				/*$('#returntop').click(function() {
					$('html,body').animate({
						scrollTop: '0px'
					}, 1000);
					return false;
				});*/
			});

			function login() {
				var loginName = $('#mobilephone').val();
				$.ajax({
					type: "get",
					dataType: 'json',
					url: servicePath+"sechandcar/app/sys/login",
					data:{loginName:loginName},
					contentType: "application/json",
					success: function(result) {
						console.log(result); //打印服务端返回的数据(调试用)
						if(result.length > 0) {
							for(var i = 0; i < result.length; i++) {
								var obj = result[i];

								$("#productselect").append("<option value=" + obj.id + ">" + obj.productname + "</option>");
							}
						}

					},
					error: function() {
					}
				});
			}
		</script>
	</body>

</html>